//
//  ZLQInspirationCell.swift
//  GoTravel
//
//  Created by lanou3g on 16/3/9.
//  Copyright © 2016年 SHH. All rights reserved.
//

import UIKit

class ZLQInspirationCell: UICollectionViewCell {
    
    var infoImage:UIImageView?
    var areaName:UILabel?
    var englishName:UILabel?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.layer.cornerRadius = 10
        self.contentView.layer.cornerRadius = 10
        self.contentView.layer.borderWidth = 0.5
        self.contentView.layer.borderColor = UIColor.clearColor().CGColor
        
        infoImage = UIImageView(frame: CGRectMake(self.contentView.frame.size.width*0.01,self.contentView.frame.size.height*0.01,self.contentView.frame.size.width,self.contentView.frame.size.height*0.65))
        infoImage?.backgroundColor = UIColor.whiteColor()
        infoImage?.layer.masksToBounds = true
        infoImage?.layer.cornerRadius = 10
        self.contentView.addSubview(infoImage!)
        
        areaName = UILabel(frame: CGRectMake(self.contentView.frame.size.width*0.01,self.contentView.frame.size.height*0.66,self.contentView.frame.size.width*0.9,self.contentView.frame.size.height*0.15))
        areaName?.text = "日本"
        areaName?.textAlignment = .Center
        self.contentView.addSubview(areaName!)
        
        englishName = UILabel(frame: CGRectMake(self.contentView.frame.size.width*0.01,self.contentView.frame.size.height*0.81,self.contentView.frame.size.width*0.9,self.contentView.frame.size.height*0.15) )
        englishName?.text = "Japan"
        englishName?.font = UIFont.systemFontOfSize(13)
        englishName?.textAlignment = .Center
        self.contentView.addSubview(englishName!)
        
        
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        infoImage?.frame = CGRectMake(self.contentView.frame.size.width*0.01,self.contentView.frame.size.height*0.01,self.contentView.frame.size.width,self.contentView.frame.size.height*0.65)
        
        areaName?.frame = CGRectMake(self.contentView.frame.size.width*0.01,self.contentView.frame.size.height*0.66,self.contentView.frame.size.width*0.9,self.contentView.frame.size.height*0.15)
        
        englishName?.frame = CGRectMake(self.contentView.frame.size.width*0.01,self.contentView.frame.size.height*0.81,self.contentView.frame.size.width*0.9,self.contentView.frame.size.height*0.15)
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
